package com.chenglu.android.mine.address.mvp.model;



import com.chenglu.android.common.net.RetrofitClient;
import com.chenglu.android.common.net.RetrofitClientCL;
import com.chenglu.android.mine.address.mvp.contract.AddressManagerContract;
import com.chenglu.android.mine.bean.AddressListBean;
import com.chenglu.android.mine.bean.AddressSubmitBean;
import com.chenglu.android.mine.bean.AddressTreeBean;
import com.chenglu.android.mine.bean.CommonDataBean;

import io.reactivex.rxjava3.core.Observable;
import okhttp3.RequestBody;

/**
 * @author: lyj
 * @Created by Copyright 2023/3/2 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 *
 */
public class AddressManagerModel implements AddressManagerContract.AddressManagerModel {

    @Override
    public Observable<AddressListBean> getAddressList(String token) {
        return RetrofitClientCL.getInstance().getApi().getAddressList(token);
    }

    @Override
    public Observable<AddressSubmitBean> getAddressSubmit(String token, RequestBody requestBody) {
        return RetrofitClientCL.getInstance().getApi().getAddressSubmit(token ,requestBody);
    }

    @Override
    public Observable<AddressSubmitBean> getAddressUpdate(String token, RequestBody requestBody) {
        return RetrofitClientCL.getInstance().getApi().getAddressUpdate(token, requestBody);
    }

    @Override
    public Observable<AddressTreeBean> getAddressTree() {
        return RetrofitClient.getInstance().getApi().getAddressTree();
    }

    @Override
    public Observable<CommonDataBean> getAddressDelete(String token, String ids) {
        return RetrofitClientCL.getInstance().getApi().getAddressDetele(token,ids);
    }

}
